package org.adorsys.aderp.booking.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
public class Reservation {

    @NotNull
    @Column(name = "reservationKeyBk", unique = true)
    private String reservationKey;

    @NotNull
    private String customer;

    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd-MM-yyyy HH:mm:ss")
    private Date checkInDate;

    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd-MM-yyyy HH:mm:ss")
    private Date checkOutDate;

    @NotNull
    @ManyToOne
    private Room room;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<RoomOption> roomOptions = new HashSet<RoomOption>();

    private Integer numberOfAdult;

    private Integer numberOfChildren;

    @NotNull
    private BigDecimal amountHT;

    private BigDecimal reduction;

    private String complement;

    @ManyToOne
    private ReservationState reservationState;

    @ManyToOne
    private InvoiceItem invoiceItem;

    @ManyToOne
    private Invoice invoice;

    @ManyToOne
    private OrgaPersonRef customerRef;

    @ManyToOne
    private OrgaPersonRef guestRef;

    private String recordOwner;
}
